#pragma once

#include <iostream>



enum class OPCODE {
	continuation = 0x0,
	text = 0x1,
	binary = 0x2,
	rsv3 = 0x3,
	rsv4 = 0x4,
	rsv5 = 0x5,
	rsv6 = 0x6,
	rsv7 = 0x7,
	close = 0x8,
	ping = 0x9,
	pong = 0xA,
	control_rsvb = 0xB,
	control_rsvc = 0xC,
	control_rsvd = 0xD,
	control_rsve = 0xE,
	control_rsvf = 0xF,

};


class WebsocketMsg
{
public:
	OPCODE opcode() const { return opcode_; }
	void opcode(OPCODE op) { opcode_ = op; }

	const std::string& payload() const { return payload_; }

	void set_payload(std::string& msg) { payload_ = std::move(msg); }
private:
	OPCODE opcode_ = OPCODE::binary;
	std::string  payload_;
};

